# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo9.10
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/5
#-------------------------------------------------------------------------------

dict = {'name':'Bill','age':40}
try:
    print(dict['Age'])
except KeyError as e:                 # 捕捉key不存在的异常
    print("异常信息：{}".format(e))
class WifiManager:
    def testWifi(self):
        print("testWifi")

wifiManager =WifiManager()
try:
    wifiManager.testWifi()
except AttributeError as e:           # 捕捉对象属性（方法也可以看作对象的属性）不存在的异常
    print("异常信息：{}".format(e))